
export default {
    state: () => ({
        //  小数百分比
        width: '0',
        // 调整播放时间
        playTime: null,
        //  歌曲总时间
        sumTime: 182,
        // 临时播放时间百分比
        temporaryTime: null,
        //  控制是否开启进度条随着鼠标移动
        flagProgressBar: false,
        //  鼠标按下进度条按钮时的X轴
        clientX: null,
        // 缓存进度条
        buffered: 0,

    }),
    getters: {
        percentageWidth(state) {
            return state.width * 100 + '%'
        },
        buffered: (state) => { return state.buffered * 100 + "%" },
    },
    mutations: {
        playTimeProgressBar: function (store, value) {
            store.width = value;
        },
        changePlayTime: function (store, value) {
            store.playTime = value;
        },
        changeSunTime: function (state, value) {
            state.sunTime = value;
        },
        temporaryTime: function (state, value) {

            state.temporaryTime = value;
        },
        changeFlagProgressBar(state, value) {

            state.flagProgressBar = value;
        },
        changeClientX(state, value) {

            state.clientX = value;
        },
        changeBuffered: function (state, value) {

            state.buffered = value;
        }

    }

}

